<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欢迎使用后台管理系统</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <style>
        .top-header {
            background: #01aaed;
            height: 50px;
            line-height: 50px;
            color: #fff;
            padding: 0 10px;
        }

        .top-header .top-title {
            font-size: 18px;
        }

        .top-header .top-account {
            float: right;
        }

        .top-username {
            color: #fff;
        }

        .left-menu {
            position: absolute;
            width: 200px;
            background: #333;
        }

    </style>
</head>

<body>
    <div class="top-header">
        <span class="top-title">super后台管理系统</span>
        <div class="top-account">
            <span class="layui-icon layui-icon-friends"></span>
            <span class="top-username">admin</span>
            <a href="javascript:;" onclick="logout()">退出</a>
        </div>
    </div>

    <!-- left menu -->
    <div class="left-menu">
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
            @foreach ($menus as $menu)
                <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">{{$menu->title}}</a>
                    <dl class="layui-nav-child">
                        @foreach ($menu->child as $key=>$val)
                    <dd><a href="javascript:;" onclick="firemenu(this)" controller="{{$val->controller}}"
                    action="{{$val->action}}">{{$val->title}}</a></dd>
                        @endforeach
                    </dl>
                </li>
            @endforeach

        </ul>
    </div>

    <div class="main">
        <div class="layui-body" style="margin-top:50px;">
            <!-- 内容主体区域 -->
            {{-- <div style="padding: 15px;">内容主体区域</div> --}}

            <iframe src="/admins/home/welcome" style="width:100%;height:100%;
        background:rgb(222, 250, 199);overflow-y:unset" frameborder="0">
            </iframe>
        </div>
    </div>
</body>

<script src="/layui/layui.js"></script>

<script>
    //注意：折叠面板 依赖 element 模块，否则无法进行功能性操作
    layui.use(['element','layer'], function() {
        var element = layui.element;
        var layer = layui.layer;
        $ = layui.jquery;

        //…
    });

    function firemenu(obj){

        var controller = $(obj).attr('controller');
        var action=$(obj).attr('action');
        var url='/admins/'+controller+'/'+action;
        $(".layui-body iframe").attr('src',url);

    }
</script>

</html>
